﻿<%@ Page Title="Account Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="AccountPage.aspx.cs" Inherits="MAA.Presentation.PRL.Account.AccountPage" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <link href="../Styles/Account.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/jquery-2.0.3.min.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <div class="account">
        <div class="accountInfomation">
            <h2>
                <asp:Label ID="langAccInfo" runat="server" Text="<%$Resources:language, langAccInfo%>"></asp:Label>
            </h2>
            <br />
            <li>
                <asp:Label class="InfoLabel" ID="langName" runat="server" Text="<%$Resources:language, langName%>"></asp:Label></label><br />
                
                <div class="InfoInput">
                    <asp:Label ID="lblName" runat="server" Text="Name"></asp:Label>
                    <asp:TextBox runat="server" ID="tbxName" MaxLength="100"></asp:TextBox>
                    <asp:Label ID="lblValName" runat="server" Text="*"></asp:Label>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Bạn phải điền tên."
                    ControlToValidate="tbxName" ForeColor="Red" SetFocusOnError="True" ValidationGroup="Edit"></asp:RequiredFieldValidator>
                </div>
            </li>
            <li>
                <asp:Label class="InfoLabel" ID="langPictureAcc" runat="server" Text="<%$Resources:language, langPictureAcc%>"></asp:Label></label><br />
                
                <div class="InfoInput">
                <asp:ImageMap ID="impProfilePicture" runat="server" Height="100" Width="100">
                </asp:ImageMap>
                <asp:FileUpload ID="fupProfilePicture" runat="server" />
                </div>
            </li>
            <li>
                <asp:Label class="InfoLabel" ID="langContact" runat="server" Text="<%$Resources:language, langContact%>"></asp:Label></label><br />
            </li>
            <div class="contact">
                <li>
                    <asp:Label  class="contactInfoLabel" ID="langEmail" runat="server" Text="Email"></asp:Label>

                    <div class="InfoInput">
                    <asp:Label ID="lblEmail" runat="server" Text="Email"></asp:Label>
                    <asp:TextBox runat="server" ID="tbxEmail" MaxLength="100"></asp:TextBox>
                    <asp:Label ID="lblValEmail" runat="server" Text="*"></asp:Label>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="<%$Resources:language, langErrEmailEntity%>"
                    ControlToValidate="tbxEmail" ForeColor="Red" SetFocusOnError="True" Display="Dynamic"
                    ValidationGroup="Edit"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="<%$Resources:language, langErrEmail%>"
                    ControlToValidate="tbxEmail" SetFocusOnError="True" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                    Display="Dynamic" ForeColor="Red" ValidationGroup="Edit"></asp:RegularExpressionValidator>
                    </div>
                </li>
                <li>
                    <asp:Label class="contactInfoLabel" ID="langPhone" runat="server" Text="<%$Resources:language, langPhone%>"></asp:Label></label><br />
                    
                    <div class="InfoInput">
                    <asp:Label ID="lblPhone" runat="server" Text="Phone"></asp:Label>
                    <asp:TextBox ID="tbxPhone" runat="server" MaxLength="12"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ErrorMessage="Số điện thoại không hợp lệ !"
                        ControlToValidate="tbxPhone" SetFocusOnError="True" ValidationExpression="[0-9]{0,}"
                        Display="Dynamic" ForeColor="Red" ValidationGroup="Edit"></asp:RegularExpressionValidator>
                    </div>
                </li>
                <li>
                    <asp:Label class="contactInfoLabel" ID="langAddress" runat="server" Text="<%$Resources:language, langAddress%>"></asp:Label></label><br />
                
                    <div class="InfoInput">
                    <asp:Label ID="lblAddress" runat="server" Text="Address"></asp:Label>
                    <asp:TextBox Style="resize: none;" runat="server" ID="tbxAddress"
                        MaxLength="255" Width="230" TextMode="MultiLine" onkeypress="return CheckLength();"></asp:TextBox>
                    </div>
                </li>
                <li>
                    <asp:Label class="contactInfoLabel" ID="langProvince" runat="server" Text="<%$Resources:language, langProvince%>"></asp:Label></label><br />
                
                    <div class="InfoInput">
                    <asp:Label ID="lblProvince" runat="server" Text="Province"></asp:Label>
                    <asp:DropDownList ID="ddlProvince" runat="server" Width="150px">
                    </asp:DropDownList>
                    </div>
                </li>
            </div>
            <br/>
            <asp:Button class="accountButton" ID="btnEdit" runat="server" Width="80px" Text="Sửa" OnClick="btnEdit_Click"
                ValidationGroup="Edit" />
            <asp:Button class="accountButton" ID="btnSaveEdit" runat="server" OnClick="btnSaveEdit_Click" Text="Lưu"
                Width="80px" ValidationGroup="Edit" />
            <asp:Button class="accountButton" ID="btnCancelEdit" runat="server" Text="Hủy bỏ" Width="80px" OnClick="btnCancelEdit_Click"
                ValidationGroup="Edit" CausesValidation="False" />
            <br/>
            <br/>
            <div class="moreInfo">
                <label>
                    <asp:Label ID="langRegisterDate" runat="server" Text="<%$Resources:language, langRegisterDate%>"></asp:Label>
                </label>
                <asp:Label ID="lblRegisterDate" runat="server" Text="dd/mm/yyyy"></asp:Label>
                <label style="margin-left: 100px;">
                    <asp:Label ID="langNumOfBeach" runat="server" Text="<%$Resources:language, langNumOfBeach%>"></asp:Label></label>
                <asp:Label ID="lblCurrentViolationNumber" runat="server" Text="x/20"></asp:Label>
            </div>
            <br />
            <br />
        </div>
        <div id="AccountPage_OpenChangePass">
            <h2>
                <asp:Label ID="langChangePass" runat="server" Text="<%$Resources:language, langChangePass%>"></asp:Label>
                <asp:ImageMap ID="ImageMap1" runat="server" ImageUrl="~/WebData/Image/WebImage/ShowMore.png">
            </asp:ImageMap>
            </h2>
        </div>
        <div id="AccountPage_ChangePass">
            <br />
            <li>
                <asp:Label ID="langPasslonger6" runat="server" Text="<%$Resources:language, langPasslonger6%>"></asp:Label>
            </li>
            <li>
                <asp:Label class="InfoLabel" ID="langOldPass" runat="server" Text="<%$Resources:language, langOldPass%>"></asp:Label></label><br /><br />
            
                <div class="InfoInput">
                    <asp:TextBox runat="server" ID="tbxOldPass" MaxLength="30"
                    TextMode="Password"></asp:TextBox>*
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="<%$Resources:language, langOldPass%>"
                    ControlToValidate="tbxOldPass" ForeColor="Red" SetFocusOnError="True" Display="Dynamic"
                    ValidationGroup="ChangePass"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="<%$Resources:language, langPassErr%>"
                    ValidationExpression="[0-9a-zA-Z]{7,}" ForeColor="Red" ControlToValidate="tbxOldPass"
                    SetFocusOnError="True" ValidationGroup="ChangePass" />
                </div>
            </li>
            <li>
                <asp:Label class="InfoLabel" ID="langNewPassword" runat="server" Text="<%$Resources:language, langNewPassword%>"></asp:Label></label><br /><br />
            
                <div class="InfoInput">
                    <asp:TextBox runat="server" ID="tbxNewPass" MaxLength="30"
                    TextMode="Password"></asp:TextBox>*
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="<%$Resources:language, langOldPass%>"
                    ControlToValidate="tbxNewPass" ForeColor="Red" SetFocusOnError="True" Display="Dynamic"
                    ValidationGroup="ChangePass"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ErrorMessage="<%$Resources:language, langPassErr%>"
                    ValidationExpression="[0-9a-zA-Z]{7,}" ForeColor="Red" ControlToValidate="tbxNewPass"
                    SetFocusOnError="True" ValidationGroup="ChangePass" />
                </div>
            </li>
            <li>
                <asp:Label class="InfoLabel" ID="langConfirmNewPass" runat="server" Text="<%$Resources:language, langConfirmNewPass%>"></asp:Label></label><br />
            
                <div class="InfoInput">
                    <asp:TextBox runat="server" ID="tbxConfirmNewPass" MaxLength="30"
                    TextMode="Password"></asp:TextBox>*
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="<%$Resources:language, langErrConfirmMailEntity%>"
                    ControlToValidate="tbxConfirmNewPass" ForeColor="Red" SetFocusOnError="True"
                    Display="Dynamic" ValidationGroup="ChangePass"></asp:RequiredFieldValidator>
                    <asp:CompareValidator ID="CompareValidator1" runat="server" ErrorMessage="Mật khẩu xác nhận chưa đúng."
                    ControlToCompare="tbxNewPass" ControlToValidate="tbxConfirmNewPass" ForeColor="Red"
                    SetFocusOnError="True" Display="Dynamic" ValidationGroup="ChangePass"></asp:CompareValidator>
                </div>
            <li>
            <asp:Button class="accountButton" ID="btnSaveChangePass" runat="server" Text="<%$Resources:language, langSave%>"
                Width="80px" OnClick="btnSaveChangePass_Click" ValidationGroup="ChangePass" />
            <asp:Button class="accountButton" ID="btnCancelChangePass" runat="server" Text="<%$Resources:language, langCancel%>"
                Width="80px" OnClick="btnCancelChangePass_Click" ValidationGroup="ChangePass"
                CausesValidation="False" />
        </div>
    </div>
    <script type="text/javascript">
        var closeTab = true;
        $('#AccountPage_OpenChangePass').bind('click', function (e) {
            if (closeTab) {
                $('#AccountPage_ChangePass').css('display', 'block');
                closeTab = false;
            }
            else {
                $('#AccountPage_ChangePass').css('display', 'none');
                closeTab = true;
            }
        });
    </script>
    <script type="text/javascript">
        function CheckLength() {
            var textbox = document.getElementById("<%=tbxAddress.ClientID%>").value;
            if (textbox.trim().length >= 255) {
                return false;
            }
            else {
                return true;
            }
        }
                    </script>
</asp:Content>
